#ifndef __MOTOR_H
#define __MOTOR_H
#include <inttypes.h>

extern int32_t phi_des,phi_act,omega_newdes,omega_des,omega_act,accel_des; // ziadany uhol natocenia, skutocny uhol natocenia, ziadane otacky, okamzite otacky, ziadana akceleracia (rampy)
#define MODE_PHI        0 // rezim polohovy
#define MODE_SPEED      1 // rezim otacky
#define MODE_SPEED_RAMP 2 // rezim rampa
extern uint8_t mode;
extern uint32_t ireg_i,ireg_p;
extern int32_t i_des,i_act;
extern int32_t fi,fi_prev;
extern int flag;
extern int8_t ramp_on;
extern int8_t rampnum;

void motor_init(void);

/*inline*/ void iREG(uint16_t *convres);
void wREG(void);

#endif
